package com.supergzt.utils;


import com.supergzt.constant.ValidateMessageConstants;
import com.supergzt.enums.HttpEnum;
import com.supergzt.exception.NoLoginException;

/**
 * @author 张钧
 * @Description
 * @create 2022-10-27 13:58
 */
public class AuthUtil {
	public static void checkLogin() {
		String token = SecurityUtils.getToken(ServletUtils.getRequest());
		if (token == null) {
			throw new NoLoginException(HttpEnum.ILLEGAL_TOKEN, ValidateMessageConstants.NO_TOKEN);
		}
		SecurityUtils.getLoginUser();
	}
}
